package com.item.controller;


import com.item.pojo.Admin;
import com.item.service.AdminService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


@RestController
@RequestMapping("/admin")
public class AdminController {

    @Autowired
    private AdminService adminService;


    @PostMapping
    public Object update(@RequestBody Admin admin){
        return adminService.update(admin);
    }

    @GetMapping("/{adminName}")
    public Object selectByName(@PathVariable String adminName){
        Admin admin1 = adminService.selectByName(adminName);
        return admin1;
    }

}
